package com.qf.six.ssm.controller.clientDetail;


import com.qf.six.ssm.commen.request.ClientDetailParam;
import com.qf.six.ssm.commen.request.ClientDetailRequestParam;
import com.qf.six.ssm.commen.vo.ResponseResult;
import com.qf.six.ssm.entity.ClientDetail;
import com.qf.six.ssm.service.clientDetail.ClientDetailService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;


/**
 * @author ZL
 */
@RestController
@RequestMapping("/consumer")
public class ClientDetailController {
    @Resource
    ClientDetailService clientDetailService;

    @GetMapping("/select/all")
    public ResponseResult<List<ClientDetail>> selectAll(){
        return ResponseResult.success(clientDetailService.selectAll());
    }

    @GetMapping("/select/by/id")
    public ResponseResult<ClientDetail> selectById(String id){
        return ResponseResult.success(clientDetailService.selectById(id));
    }

    @PostMapping("/update/consumer")
    public ResponseResult<Integer> updateConsumer(ClientDetailParam clientDetailParam){
        return ResponseResult.success(clientDetailService.updateConsumer(clientDetailParam));
    }

    @PostMapping("/insert/consumer")
    public ResponseResult<Integer> insertConsumer(@RequestBody ClientDetailRequestParam param){
        return ResponseResult.success(clientDetailService.insert(param));
    }

}
